package com.meng.basic;

public class StaticTest {
	
	
	
	public static void main(String[] args) throws Exception {
//		StaticTest.class.getClassLoader().loadClass(name)
//		Class.forName("com.meng.basic.A", false, ClassLoader.getSystemClassLoader());
//		Class.forName("com.meng.basic.A");
//		ClassLoader.class.forName("com.meng.basic.A");
		
//		String classDataRootPath = "C:\\workspace\\Classloader\\classData"; 
//	    FileSystemClassLoader fscl1 = new FileSystemClassLoader(classDataRootPath); 
//	    FileSystemClassLoader fscl2 = new FileSystemClassLoader(classDataRootPath);
		
		
		People p = new People();
		ClassLoader l = p.getClass().getClassLoader();
		while (l != null) {
			System.out.println(l.toString());
			l = l.getParent();
		}
		
		System.out.println(ClassLoader.getSystemClassLoader());
		
		new Thread() {
			public void run() {
				System.out.println(ClassLoader.getSystemClassLoader());
				System.out.println(new People().getClass().getClassLoader());
				System.out.println("A:" + A.class.getClassLoader());
			};
		}.run();
	}
	
}

class A {
	static People p = new People();
}

class People {
	People(){
		System.out.println("new people!");
	}
}
